let Mock = require("mockjs");
let Random = Mock.Random;
let faker = require('faker');
faker.locale = "zh_CN";
function generateBook() {
  let book = [];
  let user = [];
  //用户
  for(let i = 0; i <100;i++){
    let name = Mock.mock('@cname()')
    let email =  Mock.mock('@email()')
    let address = Random.county(true)
    let registrationTime = Mock.mock('@datetime')
    let profilePhoto = faker.image.people()
    let profilePhoto2 = Random.image('50x50', '#FF6600')
    let name2 = faker.name.firstName()
    const phonePrefix = ['132', '135', '189']
    const index = Math.floor(Math.random() * phonePrefix.length)
    let phone = phonePrefix[index] + Mock.mock(/\d{8}/)
    user.push({
      id:i,
      name,
      name2,
      email,
      phone,
      address,
      registrationTime,
      profilePhoto,
        profilePhoto2
    })

  }
  return {user};
}

module.exports = generateBook;


// "react-native": "G:/前端/小程序/ReactNative/课堂文件/react-native/ReactNative课程资料/01.开发工具IDE/react-native-sdk-40.0.1.tar.gz",